package com.yy.maker.template.enums;

import cn.hutool.core.util.ObjectUtil;
import lombok.Getter;
import sun.dc.pr.PRError;

/**
 * @author lyy
 * @description
 * @create 2024/1/16 21:31
 */
@Getter
public enum FileFilterRangeEnum {
    FILE_NAME("文件名字", "fileName"),
    FILE_CONTENT("文件内容", "fileContent");

    private final String text;
    private final String value;

    FileFilterRangeEnum(String text, String value) {
        this.text = text;
        this.value = value;
    }

    public static FileFilterRangeEnum getEnumByValue(String value) {
        if (ObjectUtil.isEmpty(value)) {
            return null;
        }
        for (FileFilterRangeEnum anEnum : FileFilterRangeEnum.values()) {
            if (anEnum.value.equals(value)) {
                return anEnum;
            }
        }

        return null;
    }
}
